package com.liu.sx.util;

import io.netty.buffer.ByteBuf;

public class ReadBufUtil {

    public static byte[] readByCommad(ByteBuf in,byte type){
        byte [] buf =null;
        byte comm =0;
        switch (type){
            case 1:
            case 2:
            case 4:
                buf =in.readBytes(new byte[6]).array();
                break;
            case 3:
                buf =in.readBytes(new byte[2]).array();
                break;
            case 5:
            case 6:
            case 16:
            case 33:
                comm =in.readByte();
                buf = new byte[1];
                buf[0]=comm;
                break;
            case 32://登录
             break;
            case 34:
                buf =in.readBytes(new byte[100]).array();
                break;


        }

      return buf;

    }

    public static void main(String[] args) {
        System.out.println( CodeType.OXO6.getCode());
    }

}
